package com.cloud.controller.goods;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cloud.bean.goods.Goods;
import com.cloud.common.BaseReturn;
import com.cloud.controller.goods.from.FromGoods;
import com.cloud.service.goods.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liuyuan
 * @since 2022-11-11
 */
@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    GoodsService goodsService;

    @RequestMapping("/query")
    public BaseReturn query(@RequestBody FromGoods fromGoods){
        Page<Goods> objectPage = new Page<>(fromGoods.getPage(),fromGoods.getSize());
        IPage<Goods> page = goodsService.page(objectPage);
        return BaseReturn.build("2000","查询成功",page);
    }



}

